<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Textbook Crossroads - Browse Books</title>
  <link rel="stylesheet" href="<%=request.getContextPath() %>/default.css" type="text/css">
</head>
<body>

<div id="header">
	<div id="logo">
		<h1>
			<html:img width="40" src="../images/EMPTY.GIF"/>
			<html:link page="/pages/home.jsp">Textbook Crossroads</html:link>
		</h1>
		<h2>Team 14 - LoneTree</h2>
	</div>
	<div id="menu">
		<ul>
			<li>
			<logic:notPresent name="logged_in_user_in_session">
			<html:link page="/pages/home.jsp">Home</html:link>
			</logic:notPresent>
			<logic:present name="logged_in_user_in_session">
			<logic:equal value="false" name="logged_in_user_in_session" property="admin">
			<html:link action="/PrepForMyBooks">Dashboard</html:link>
			</logic:equal>
			<logic:equal value="true" name="logged_in_user_in_session" property="admin">
			<html:link page="/pages/admindashboard.jsp">Dashboard</html:link>
			</logic:equal>
			</logic:present>
			</li>
			<li class="active"><html:link page="/pages/books.jsp">Books</html:link></li>
			<li><html:link page="/pages/courses.jsp">Courses</html:link></li>
			<li><html:link page="/pages/about.jsp">About</html:link></li>
			<li class="logon">
			<logic:notPresent name="logged_in_user_in_session">
			<html:link page="/pages/logon.jsp">LogIn</html:link>
			</logic:notPresent>
			<logic:present name="logged_in_user_in_session">
			<html:link action="/logout">LogOut</html:link>
			</logic:present>
			</li>
		</ul>
	</div>
</div>

<div id="content">
	<div id="sidebar">
		<div id="categories">
			<div id="archives" class="boxed">
				<logic:notPresent name="logged_in_user_in_session">
						<h2>Contributors</h2>
				</logic:notPresent>
			
				<logic:present name="logged_in_user_in_session">			
					<logic:equal value="true" name="logged_in_user_in_session" property="admin">						
						<h2>Admin Actions</h2>										
					</logic:equal>
				
					<logic:equal value="false" name="logged_in_user_in_session" property="admin">
						<h2>MyActions</h2>						
					</logic:equal>
				</logic:present>
				
				<div class="content">
					<logic:notPresent name="logged_in_user_in_session">
						<ul>
							<li>Andrew Lee</li>
							<li>Bojan Martin</li>
							<li>Dimeji Omikunle</li>
							<li>Minghui Yu</li>
						</ul>
					</logic:notPresent>
					
					<logic:present name="logged_in_user_in_session">
						<ul>
							<logic:equal value="false" name="logged_in_user_in_session" property="admin">
					    		<li><html:link page="/PrepForMyBooks.do?manage=books">Manage MyBooks</html:link></li>
					            <li><html:link page="/PrepForMyBooks.do?manage=sections">Manage MySections</html:link></li>
					            <li><html:link action="/UpdateMyProfile">Update MyProfile</html:link></li>
							</logic:equal>
							
							<logic:equal value="true" name="logged_in_user_in_session" property="admin">
					    		<li><html:link page="/pages/bookadmin.jsp"><bean:message
					            key="adminbook.link"/></html:link></li>
					            
					            <li><html:link action="/AdminCourses"><bean:message
					            key="admincourses.link"/></html:link></li>
					            
					            <li><html:link action="/AdminAccounts"><bean:message
					            key="adminaccounts.link"/></html:link></li>
					            
					            <li><html:link action="/AdminComments"><bean:message
					            key="admincomments.link"/></html:link></li>
							</logic:equal>
						</ul>	
					</logic:present>
				</div>
			</div>
		</div>
	</div>
	
	<div id="posts">
		<div class="post">
			<h2 class="title">Browse Books</h2>
			<div class="meta">
				<p class="date">All Books:</p>
			</div>
			<div class="story">
	

<logic:notPresent name="books">
No books in the system
</logic:notPresent>

  <logic:present name="books">
  
  <logic:notEmpty name="books">
  <ol>
  <logic:iterate id="book" name="books" indexId="cnt">
   <li><html:link page="/ViewBookDetails.do" paramName="book" paramProperty="isbn" paramId="isbn">
	<bean:write name="book" property="title" /></html:link></li>
	</logic:iterate>  
	</ol>
  </logic:notEmpty>
    
    <logic:empty name="books">
    Database search does not return any result
    </logic:empty>
  
  </logic:present>

</body>
</html>